import 'package:qr_code_app/generated/json/base/json_convert_content.dart';
import 'package:qr_code_app/module/diary/entity/log_entity.dart';
import 'package:intl/intl.dart';


LogEntity $LogEntityFromJson(Map<String, dynamic> json) {
  final LogEntity logEntity = LogEntity();
  final String? image = jsonConvert.convert<String>(json['image']);
  if (image != null) {
    logEntity.image = image;
  }
  final String? content = jsonConvert.convert<String>(json['content']);
  if (content != null) {
    logEntity.content = content;
  }
  final String? timestamp = jsonConvert.convert<String>(json['timestamp']);
  if (timestamp != null) {
    logEntity.timestamp = timestamp;
  }
  return logEntity;
}

Map<String, dynamic> $LogEntityToJson(LogEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['image'] = entity.image;
  data['content'] = entity.content;
  data['timestamp'] = entity.timestamp;
  return data;
}

extension LogEntityExtension on LogEntity {
  LogEntity copyWith({
    String? image,
    String? content,
    String? timestamp,
  }) {
    return LogEntity()
      ..image = image ?? this.image
      ..content = content ?? this.content
      ..timestamp = timestamp ?? this.timestamp;
  }
}